Skip to content

feat: add concurrent upscale (MAPCO-3529) - #119

Merged
asafMasa merged 7 commits into
masterfrom
concurrentUpscale
Oct 24, 2023
Merged

feat: add concurrent upscale (MAPCO-3529)#119
asafMasa merged 7 commits into
masterfrom
concurrentUpscale

Conversation

@asafMasa

Copy link
Copy Markdown
Contributor
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Support concurrent get tiles for upscale

@asafMasa
asafMasa requested a review from shimoncohen October 10, 2023 07:25
@asafMasa asafMasa added In Review code review in progress enhancement New feature or request labels Oct 10, 2023
@asafMasa asafMasa changed the title feat: add concurrent upscale feat: add concurrent upscale (MAPCO-3529) Oct 10, 2023
Comment thread MergerLogic/DataTypes/Data.cs Outdated
Tile? lastTile = null;
coordsList.Add(new Coord(i, baseTileX, baseTileY));
}
var response = this.InternalGetExistingTile(coordsList.ToArray());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this function please move it's code to here and remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread MergerLogic/DataTypes/Data.cs Outdated
}

// Async method to request all tiles that can be used for "upscale" concurrently
var responseOfGetlastTileAsync = async delegate (Coord[] coordsArray)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to getUpscaleTiles.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread MergerLogic/DataTypes/Data.cs Outdated
Comment on lines +235 to +245
if (zOrderToTileDictionary.IsEmpty)
{
break;
return null;
}
}
string message = lastTile == null ? "null" : $"z:{lastTile.Z}, x:{lastTile.X}, y:{lastTile.Y}";
this._logger.LogDebug($"[{MethodBase.GetCurrentMethod().Name}] ended, lastTile: {message}");
return lastTile;
// Get first valid tile that can be upscaled
List<KeyValuePair<int, Tile?>> list = new List<KeyValuePair<int, Tile?>>(zOrderToTileDictionary.ToArray());
var orderedList = list.OrderBy(kvp => kvp.Key);
Tile? lastTile = orderedList.Last().Value;
string message = lastTile == null ? "null" : $"z:{lastTile.Z}, x:{lastTile.X}, y:{lastTile.Y}";
this._logger.LogDebug($"[{MethodBase.GetCurrentMethod().Name}] ended, lastTile: {message}");
return lastTile;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move outside to the function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread MergerLogic/DataTypes/Data.cs Outdated

// Go over zoom levels until a tile is found (may not find tile)
// Define all tiles coordinates that needs to be requested for upscale
List<Coord> coordsList = new List<Coord>(MaxZoomRead - (MaxZoomRead - coords.Z));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to coords.Z as limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request In Review code review in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants